{include file="public/uheader"}
<div class="main order">
    {include file="user/common"}
    <div class="purplebox">
        <div class="orbox debox">
            <h1><i class="iconfont icon-qianbao4"></i>提现到微信钱包</h1>
            <h6>提现金额</h6>
            <form>
                <label for="deposit">￥</label>
                <input type="text" placeholder="{$account['can_out_balance']}" id="depoist">
                <p>可提现余额￥<span class="price">{$account['can_out_balance']}</span><span class="f-right alldepo">全部提现</span></p>
                <a href="javascript:;" class="hongbtn extract-money">确认提现</a>
            </form>
        </div>
    </div>
    <div class="fot">
        <p>Copiright @2012-2018</p>
        <p>美育儿meiyuer.com 版权所有</p>
    </div>
</div>

<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="/static/index/js/layer/layer.js"></script>
<script type="text/javascript" src="/static/index/js/jquery-weui.min.js"></script>
<script type="text/javascript" src="/static/index/js/layer.js"></script>
<script type="text/javascript" src="/static/index/js/fastclick.js"></script>
<script type="text/javascript" src="/static/index/js/common.js"></script>
<script>
    // 全部提现
    $('.alldepo').on('click',function () {
        var t = $(this).siblings('.price').text();
        $('#depoist').val(t);
    })

    // 确认提现
    $('.extract-money').on('click', function() {
        var thisObj = $(this).parents('form');
        var maxAmount = thisObj.find('.price').text();
        var amount = thisObj.find('#depoist').val();
        if(amount > maxAmount) {
            layer.msg('提现金额大于可提现余额');
        } else {
            ajaxPost('/user/extractDeposit', {amount: amount}, function() {
                window.location.href = '/deal/outsuccess/activity_id' + activity.id + '.html';
            })
        }
    })
</script>
{include file="public/footer"}
